/**
 * create by Alec
 */
import { createAction } from "redux-actions";
import fetch from "../../utils/fetch.js";

// export const getWeeklyReportQuery = createAction("WEEKLY");
export const fetchWeeklyReportQuery = param => () =>
    fetch(`/hrmregister/mobile/weekly/report/query`, {
        body: param,
        meta: {
            dipId: 69894
        }
    })
    // .then(res => {
    //     if (res.success) {
    //         dispatch(getWeeklyReportQuery(res.result));
    //     }
    //     return res;
    // });

export const fetchGetOnJobNum = param => () =>
    fetch(`/hrmregister/mobile/weekly/analysis/getOnJobNum`, {
        body: param,
        meta: {
            dipId: 69957
        }
    })

export const fetchGetOnJobDataAnalysis = params => () =>
    fetch(`/hrmregister/mobile/weekly/analysis/getOnJobDataAnalysis`, {
        method: "GET",
        params,
        meta: {
            dipId: 69958
        }
    })

export const fetchWeeklyReportDetail = param => () =>
    fetch(`/hrmregister/mobile/weekly/report/detail`, {
        body: param,
        meta: {
            dipId: 69895
        }
    })